using UnityEngine;
using UnityEditor;

[CustomEditor(typeof(TBullet))]
public class TBulletInspector : Editor {

	protected TBullet bullet;
	
	protected virtual void OnEnable()
	{
		bullet = target as TBullet;
	}
	
	public override void OnInspectorGUI ()
	{
		base.OnInspectorGUI ();
		
		GUILayout.BeginVertical();
		
		int id = EditorGUILayout.IntField("Id", bullet.Id);
		if(id != bullet.Id){bullet.Id = id;}
		
		float speed = EditorGUILayout.FloatField("Speed", bullet.MoveSpeed);
		if(speed != bullet.MoveSpeed){bullet.MoveSpeed = speed;}
		
		BulletTypeEnum bulletType = (BulletTypeEnum)EditorGUILayout.EnumPopup("BulletType", bullet.BulletType);
		if(bulletType != bullet.BulletType){bullet.BulletType = bulletType;}
		
		BulletMoveTypeEnum bulletMoveType = (BulletMoveTypeEnum)EditorGUILayout.EnumPopup("BulletMoveType", bullet.BulletMoveType);
		if(bulletMoveType != bullet.BulletMoveType){bullet.BulletMoveType = bulletMoveType;}
		
		GUILayout.EndVertical();
	}
}
